package cn.itsource.controller.admin;

import cn.dev33.satoken.annotation.SaIgnore;
import cn.itsource.pojo.dto.AdminDto;
import cn.itsource.pojo.vo.LoginVo;
import cn.itsource.result.R;
import cn.itsource.service.ILoginService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * 📖：beishan
 * 🗓️：2024/4/2 12:36
 * =====================
 */
@RestController

@RequestMapping("/admin")
public class AdminLoginController {
    @Autowired
    private ILoginService loginService;

    @PostMapping("/login")
    @SaIgnore
    public R login(@RequestBody @Valid AdminDto adminDto){
        LoginVo loginVo = loginService.adminLogin(adminDto);
        return R.success(loginVo);
    }

}
